package com.vgulu.server.common.utils;

import java.util.Random;

/**
 * Created by Administrator on 2014/9/19 0019.
 */
public class RandomStrUtil {

    private final static char[] chars ="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789".toCharArray();
    private final static Random random = new Random();

    public static String getRandLetterAndNumStr(int length){
        StringBuilder stringBuilder = new StringBuilder(length);
        for(int i=0;i<length;i++){
            stringBuilder.append(chars[random.nextInt(chars.length)]);
        }

        return stringBuilder.toString();
    }

    public static void main(String[] args){
        for(int i=0;i<1000;i++){
            System.out.println(getRandLetterAndNumStr(10));
        }
    }
}
